<!DOCTYPE html>
<!--
 * Copyright (c) 2009 The Chromium Authors. All rights reserved.  Use of this
 * source code is governed by a BSD-style license that can be found in the
 * LICENSE file.
-->
<html>
  <head>
    <script type="text/javascript" src="oauth2/oauth2.js"></script>
    <script type="text/javascript" src="piccal.js"></script>
    <script>
    
    //---- TALK TO SCRIPTS ----//
    chrome.extension.onRequest.addListener(function (request, sender, sendResponse) {
      console.log(new Date().getTime() + " : " + request.action);
      if (request.action == "photos") {
        sendResponse({"photos": photos});
      }
      else if (request.action == "reload") {
        console.log(new Date().getTime() + " : " + localStorage.user + ' - ' + request.user);
        if (request.user != '' && localStorage.user != request.user) {
          if (localStorage.user) {
            logout();
            console.log(new Date().getTime() + " : logout");
            getAlbums();
          }
          localStorage.user = request.user;
        }
      }  
    });
    //---- END TALK TO SCRIPTS ----//

    </script>
  </head>
  <body onLoad="getAlbums()";>
    <script>
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-26016745-1']);
      _gaq.push(['_trackPageview']);
  
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = 'https://ssl.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
  </body>
</html>